The job schedule cron new command creates a cron schedule (that is, a schedule that runs at a specified time). When you create a cron schedule, you specify a name for the schedule and the time or times at which it is to run. You can specify time in the following units:
As a month or months. Possible values include January, February, March, April, May, June, July, August, September, October, November, and December, or all for an unspecified month setting.
As a day or days of the week. Possible values include Sunday, Monday, Tuesday, Thursday, Friday, and Saturday, or all for an unspecified day-of-the-week setting.
As a day or days of the month. Possible values range from 1 to 31.
As an hour or hours. Possible values range from 0 (midnight) to 23 (11:00 p.m.), or all for an unspecified hour setting.
As a minute or minutes. Possible values range from 0 to 59.
If values are specified for both day or days of the month and day or days of the week, they are considered independently; for example, a cron schedule with the day specification Friday, 13 runs every Friday and on the 13th day of each month, not just on every Friday the 13th. If a schedule specifies a nonexistent time, any tasks associated with the schedule do not run on the nonexistent time. For example, if you specify a schedule that runs each month on the 30th, a task associated with the schedule does not run in February; that is, the task runs on January 30 and not again until March 30.
The following example creates a cron schedule named midnight that runs every day at 12:00 a.m.
node::>job schedule cron new -name midnight -hour 0 -minute 0
The following example creates a cron schedule named triweekly that runs every Monday, Wednesday, and Friday at 3:00 a.m.
node::>job schedule cron new -name triweekly -dayofweek Monday,Wednesday,Friday -hour 3
The following example creates a cron schedule named biyearly that runs on March 1 and September 1 at 8:30 p.m.
node::>job schedule cron new -name biyearly -month March,September -day 1 -hour 20 -minute 30
To display information about cron schedules, use the job schedule cron show command. The command displays the schedule name and the schedule's description (that is, when it runs). Other information is displayed in a detailed view and if other parameters are specified. See the reference page for the command for details.
The following example displays information about all cron schedules.
node::>job schedule cron showName Description biyearly Mar,Sep 1@20:30 logrotationsched Sun@0:00 midnight @0:00 triweekly Mon,Wed,Fri@3:00
The following example displays detailed information about the cron schedule named triweekly.
node::>job schedule cron show -name triweeklyName: triweekly Month: - Day of Week: Monday, Wednesday, Friday Day: - Hour: 3 Minute: 0 Description: Mon,Wed,Fri@3:00
The job schedule cron modify command enables you to modify a cron schedule. You can change any of the time parameters associated with a schedule but not the schedule's name. To change a schedule's name, delete it and recreate it with the new name.
The following example modifies the cron schedule named biyearly to run in January and July.
node::>job schedule cron modify -name biyearly -month January,Julynode::>job schedule cron show -name biyearlyName: biyearly Month: January, July Day of Week: - Day: 1 Hour: 20 Minute: 30 Description: Jan,Jul 1@20:30